<html>
 <head>
  <meta charset="UTF-8">
 </head>
 <body>
  <h1 data-lake-id="HiYxF" id="HiYxF"><span data-lake-id="uc87f5b0a" id="uc87f5b0a">典型回答</span></h1>
  <p data-lake-id="uc6894fc3" id="uc6894fc3"><br></p>
  <p data-lake-id="u39ba50c9" id="u39ba50c9"><span data-lake-id="u77fbc9fa" id="u77fbc9fa">CI是Continuous Integration，翻译过来是持续集成，CD可以是Continuous Delivery也可以是</span><span data-lake-id="u36d2bada" id="u36d2bada" style="color: rgb(18, 18, 18)">Continuous Deployment</span><span data-lake-id="ubbab2a25" id="ubbab2a25">，翻译过来分别是持续交付和持续部署。</span></p>
  <p data-lake-id="u5b4df9ff" id="u5b4df9ff"><span data-lake-id="u35e8d71c" id="u35e8d71c">​</span><br></p>
  <p data-lake-id="uc5b9966e" id="uc5b9966e"><strong><span data-lake-id="u3e49e5f7" id="u3e49e5f7">持续集成</span></strong></p>
  <p data-lake-id="u593d2e84" id="u593d2e84"><strong><span data-lake-id="u8948e401" id="u8948e401">​</span></strong><br></p>
  <p data-lake-id="ufe4cd51c" id="ufe4cd51c"><span data-lake-id="uc7ba5968" id="uc7ba5968">持续集成是一种软件开发实践，要求开发者经常集成其变更，方式是将变更合并到主干（trunk）。</span></p>
  <p data-lake-id="ubc2b4afa" id="ubc2b4afa"><span data-lake-id="u358b1d53" id="u358b1d53">​</span><br></p>
  <p data-lake-id="u57c4488c" id="u57c4488c"><span data-lake-id="ufb79ec5e" id="ufb79ec5e">持续集成通常通过自动化的构建判定多个变更是否已就绪来实现，也就是说，持续集成可以快速地决定一组变更是否可部署，也可以检测到应用内容的遗漏，包括代码错误、缺失的文件，以及</span><strong><span data-lake-id="u12f89e0f" id="u12f89e0f">单元测试</span></strong><span data-lake-id="u9948c24a" id="u9948c24a">中潜在的错误。</span></p>
  <p data-lake-id="uff52f119" id="uff52f119"><img src="https://cdn.nlark.com/yuque/0/2022/png/5378072/1672143640903-3ff2980a-f974-4c37-9a4b-1779943f11f2.png?x-oss-process=image%2Fwatermark%2Ctype_d3F5LW1pY3JvaGVp%2Csize_29%2Ctext_SmF2YSA4IEd1IFA%3D%2Ccolor_FFFFFF%2Cshadow_50%2Ct_80%2Cg_se%2Cx_10%2Cy_10"></p>
  <p data-lake-id="u366f6af4" id="u366f6af4"><span data-lake-id="u63eb6507" id="u63eb6507">​</span><br></p>
  <p data-lake-id="ua428c4d3" id="ua428c4d3"><span data-lake-id="ue2539157" id="ue2539157">持续集成强调开发人员提交了新代码之后，立刻进行构建、（单元）测试。根据测试结果，我们可以确定新代码和原有代码能否正确地集成在一起。</span></p>
  <p data-lake-id="ua5b3fa9a" id="ua5b3fa9a"><span data-lake-id="u7018ed63" id="u7018ed63">​</span><br></p>
  <p data-lake-id="u793d0324" id="u793d0324"><strong><span data-lake-id="u37fcae14" id="u37fcae14">持续交付</span></strong></p>
  <p data-lake-id="u2900cd01" id="u2900cd01"><strong><span data-lake-id="u9a6e6cf6" id="u9a6e6cf6">​</span></strong><br></p>
  <p data-lake-id="u3b37189a" id="u3b37189a"><span data-lake-id="uede9e470" id="uede9e470">持续交付（CD）是一种软件开发实践，旨在早期、快速、可靠地发布高质量软件，以满足业务需求。</span></p>
  <p data-lake-id="ub7b105ce" id="ub7b105ce"><span data-lake-id="ubaeea77a" id="ubaeea77a">​</span><br></p>
  <p data-lake-id="u39ff0847" id="u39ff0847"><span data-lake-id="u85677980" id="u85677980">持续交付构建、测试和部署系统，这些步骤综合在一起以实现及时部署，包括自动化测试、可跟踪性和可扩展性，以及触发维护活动时的预警。</span></p>
  <p data-lake-id="ud6cb0e01" id="ud6cb0e01"><img src="https://cdn.nlark.com/yuque/0/2022/webp/5378072/1672143658049-8c7aee98-483a-4231-94a0-48f4179f8037.webp?x-oss-process=image%2Fwatermark%2Ctype_d3F5LW1pY3JvaGVp%2Csize_29%2Ctext_SmF2YSA4IEd1IFA%3D%2Ccolor_FFFFFF%2Cshadow_50%2Ct_80%2Cg_se%2Cx_10%2Cy_10"></p>
  <p data-lake-id="u1af7793d" id="u1af7793d"><span data-lake-id="u7cc8ccf2" id="u7cc8ccf2">持续交付在持续集成的基础上，将集成后的代码部署到更贴近真实运行环境的「类生产环境」（production-like environments）中。比如，我们完成单元测试后，可以把代码部署到连接数据库的 Staging 环境中更多的测试。如果代码没有问题，可以继续手动部署到生产环境中。</span></p>
  <p data-lake-id="uc2afafa7" id="uc2afafa7"><span data-lake-id="u7e089e8f" id="u7e089e8f">​</span><br></p>
  <p data-lake-id="u64044678" id="u64044678"><strong><span data-lake-id="ucaaf9272" id="ucaaf9272">持续部署</span></strong></p>
  <p data-lake-id="uaf63a3cb" id="uaf63a3cb"><strong><span data-lake-id="ue0e7d1e5" id="ue0e7d1e5">​</span></strong><br></p>
  <p data-lake-id="uc36d156d" id="uc36d156d"><span data-lake-id="u03dac898" id="u03dac898">持续部署（CD）指的是在持续集成完成后，直接向生产环境部署应用，或者是定期将新功能部署到生产环境的过程。</span></p>
  <p data-lake-id="ubfecc5ca" id="ubfecc5ca"><span data-lake-id="u2fd2acb5" id="u2fd2acb5">​</span><br></p>
  <p data-lake-id="u87b8548c" id="u87b8548c"><span data-lake-id="u1fa58534" id="u1fa58534">持续部署通常需要由一组自动化步骤来实现，比如云计算，必要的负载均衡和其它依赖准备工作。</span></p>
  <p data-lake-id="ubcd3d144" id="ubcd3d144"><img src="https://cdn.nlark.com/yuque/0/2022/webp/5378072/1672143798223-85bf0433-15c1-4561-90b4-6c4623768a8a.webp?x-oss-process=image%2Fwatermark%2Ctype_d3F5LW1pY3JvaGVp%2Csize_29%2Ctext_SmF2YSA4IEd1IFA%3D%2Ccolor_FFFFFF%2Cshadow_50%2Ct_80%2Cg_se%2Cx_10%2Cy_10"></p>
  <p data-lake-id="u867f8327" id="u867f8327"><span data-lake-id="u6577a7b8" id="u6577a7b8">持续部署则是在持续交付的基础上，把部署到生产环境的过程自动化。</span></p>
  <p data-lake-id="udf2db6ed" id="udf2db6ed"><span data-lake-id="u2606f7f5" id="u2606f7f5">​</span><br></p>
 </body>
</html>